//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.example.mall.dto;

import com.example.mall.mbg.model.Score;
import com.example.mall.mbg.model.Supplier;

import java.text.SimpleDateFormat;

public class ScoreDto extends Score {
    private Supplier supplier;

    public ScoreDto(Score score) {
        this.setScoreid(score.getScoreid());
        this.setSupplierid(score.getSupplierid());
        this.setPeriod(score.getPeriod());
        this.setTotalscore(score.getTotalscore());
        this.setScoredate(score.getScoredate());
        this.setRatinglevel(score.getRatinglevel());
        this.setRatingdescription(score.getRatingdescription());
        this.setCreatetime(score.getCreatetime());
        this.setUpdatetime(score.getUpdatetime());
    }

    public void setSupplier(Supplier supplier) {
        this.supplier = supplier;
    }

    public Supplier getSupplier() {
        return this.supplier;
    }

    public String getFmtCreateDate() {
        if (getCreatetime() != null) {
            SimpleDateFormat f = new SimpleDateFormat("yyyy/MM/dd");
            return f.format(getCreatetime());
        } else {
            return "";
        }
    }
}
